// var i;
// var AL_GAME_HUA_Instance = require("./AL_GAME_HUA_Instance");
// var AL_GAME_HUA_Define = require("./AL_GAME_HUA_Define");
// var AL_GAME_HUA_LatticeConfig = require("./AL_GAME_HUA_LatticeConfig");
// var AL_GAME_HUA_GameData = require("./AL_GAME_HUA_GameData");
// var AL_GAME_HUA_DateData = require("./AL_GAME_HUA_DateData");
// var AL_GAME_HUA_PlayerInfo = require("./AL_GAME_HUA_PlayerInfo");
// var AL_GAME_HUA_EmailData = require("./AL_GAME_HUA_EmailData");
// var AL_GAME_HUA_Common = require("./AL_GAME_HUA_Common");
// var AL_GAME_HUA_GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");
// var AL_GAME_HUA_ServerBackup = require("./AL_GAME_HUA_ServerBackup");
// var g = cc._decorator;
// var y = g.ccclass;
// var m = g.property;
// var v = (g.menu, !1);
// var D = (function (e) {
//     function t() {
//         var t = (null !== e && e.apply(this, arguments)) || this;
//         t.label_info = null;
//         t.scroll_view_info = null;
//         t.editbox_level = null;
//         t.editbox_diff = null;
//         t.label_button_info = null;
//         t.label_date = null;
//         return t;
//     }
//     __extends(t, e);
//     t.prototype.start = function () {
//         if (AL_GAME_HUA_Instance.Instance.Game) {
//             this.chushihua_ui();
//             this.xianshi_shishi_huo_jichu_xinxi();
//         }
//     };
//     t.prototype.xianshi_shishi_huo_jichu_xinxi = function () {
//         if (AL_GAME_HUA_Instance.Instance.Game) {
//             v
//                 ? ((this.label_button_info.string = "基础"), this.refresh_real_time())
//                 : ((this.label_button_info.string = "实时"), this.shuaxin_jichu_xinxi());
//         }
//     };
//     t.prototype.chushihua_ui = function () {
//         this.editbox_diff.string = AL_GAME_HUA_GameData.GameData.getInstance().huoqu_dangqian_nandu().toString();
//         this.label_date.string = "" + new Date(AL_GAME_HUA_DateData.DateData.getInstance().huoqu_dangqian_shijian()).toLocaleDateString();
//     };
//     t.prototype.handle_button_callback = function (e, t) {
//         switch (t) {
//             case "infoButton":
//                 v = !v;
//                 this.xianshi_shishi_huo_jichu_xinxi();
//                 break;
//             case "close":
//                 this.node.destroy();
//                 break;
//             case "skip":
//                 if (AL_GAME_HUA_Instance.Instance.Game) {
//                     AL_GAME_HUA_Instance.Instance.Game.chuli_youxi_shengli();
//                 }
//                 break;
//             case "choose":
//                 if (!AL_GAME_HUA_Instance.Instance.Game) {
//                     return;
//                 }
//                 if (AL_GAME_HUA_Instance.Instance.LevelType == AL_GAME_HUA_Define.Define.LevelType.CHALLENGE) {
//                     return void AL_APP_SDK_MANAGER.showToast("挑战模式不可选关");
//                 }
//                 AL_GAME_HUA_Instance.Instance.LevelType == AL_GAME_HUA_Define.Define.LevelType.NORMAL
//                     ? Number(this.editbox_level.string) > 0
//                         ? ((AL_GAME_HUA_GameData.GameData.getInstance().unlockLevel = parseInt(this.editbox_level.string)),
//                           AL_GAME_HUA_Instance.Instance.Game && AL_GAME_HUA_Instance.Instance.Game.chuli_youxi_chongxinkaishi())
//                         : AL_APP_SDK_MANAGER.showToast("关卡数不合法")
//                     : AL_GAME_HUA_Instance.Instance.LevelType == AL_GAME_HUA_Define.Define.LevelType.SPECIAL &&
//                       (Number(this.editbox_level.string) > 0
//                           ? ((AL_GAME_HUA_GameData.GameData.getInstance().specialUnlockLevel = parseInt(
//                                 this.editbox_level.string
//                             )),
//                             AL_GAME_HUA_Instance.Instance.Game && AL_GAME_HUA_Instance.Instance.Game.chuli_youxi_chongxinkaishi())
//                           : AL_APP_SDK_MANAGER.showToast("关卡数不合法"));
//                 break;
//             case "restart":
//                 if (AL_GAME_HUA_Instance.Instance.Game) {
//                     AL_GAME_HUA_Instance.Instance.Game.chuli_youxi_chongxinkaishi();
//                 }
//                 break;
//             case "dif":
//                 var n = Number(this.editbox_diff.string);
//                 n >= 0
//                     ? AL_GAME_HUA_GameData.GameData.getInstance().shezhi_dangqian_nandu(n)
//                     : AL_APP_SDK_MANAGER.showToast("难度数不合法");
//                 break;
//             case "prop":
//                 AL_GAME_HUA_GameData.GameData.getInstance().genggai_prop_shuliang(3, 10);
//                 AL_GAME_HUA_GameData.GameData.getInstance().genggai_prop_shuliang(4, 10);
//                 AL_GAME_HUA_GameData.GameData.getInstance().genggai_prop_shuliang(5, 10);
//                 AL_GAME_HUA_GameData.GameData.getInstance().genggai_prop_shuliang(6, 10);
//                 break;
//             case "reduceTime":
//                 AL_GAME_HUA_Instance.Instance.Game.gameTime += 30;
//                 break;
//             case "nextDay":
//                 AL_GAME_HUA_GameData.GameData.getInstance().nowDate
//                     ? (AL_GAME_HUA_GameData.GameData.getInstance().nowDate += 864e5)
//                     : (AL_GAME_HUA_GameData.GameData.getInstance().nowDate = Date.now() + 864e5);
//                 AL_GAME_HUA_DateData.DateData.getInstance().jiancha_riqi_he_zhou_shifou_xuyao_shuaxin();
//                 this.label_date.string =
//                     "" + new Date(AL_GAME_HUA_DateData.DateData.getInstance().huoqu_dangqian_shijian()).toLocaleDateString();
//                 break;
//             case "zengjia_dengji":
//                 AL_GAME_HUA_PlayerInfo.PlayerInfo.getInstance().zengjia_dengji();
//                 break;
//             case "add_Medal":
//                 AL_GAME_HUA_PlayerInfo.PlayerInfo.getInstance().add_Medal(1);
//                 break;
//             case "test_email":
//                 this.test_email();
//                 break;
//             case "debug_rank":
//                 this.debug_rank();
//                 break;
//             case "clear_storage":
//                 this.clear_storage();
//         }
//     };
//     t.prototype.debug_rank = function () {
//         AL_GAME_HUA_PlayerInfo.PlayerInfo.getInstance().ceshihuanjing_shengcheng_wanjia_xinxi();
//         AL_GAME_HUA_PlayerInfo.PlayerInfo.getInstance().tijiao_dengji_dao_shijie_paihangbang(Math.get_random_int(1, 1e4));
//     };
//     t.prototype.clear_storage = function () {
//         AL_GAME_HUA_ServerBackup.ServerBackup.qingchu_cundang().then(function () {
//             AL_APP_SDK_MANAGER.showToast("存档清除完成");
//         });
//     };
//     t.prototype.test_email = function () {
//         AL_GAME_HUA_EmailData.EmailData.getInstance().tianjia_youjian({
//             id: AL_GAME_HUA_Common.Common.huoqu_dangqian_shijian(),
//             title: "测试邮件1",
//             desc: "测试邮件1内容",
//             type: 2,
//             createTime: AL_GAME_HUA_Common.Common.huoqu_dangqian_shijian(),
//             validTime: 1,
//             rewards: [
//                 {
//                     goodsId: AL_GAME_HUA_GoodsConfig.GoodsId.gold,
//                     num: 10
//                 },
//                 {
//                     goodsId: AL_GAME_HUA_GoodsConfig.GoodsId.vit,
//                     num: 5
//                 },
//                 {
//                     goodsId: AL_GAME_HUA_GoodsConfig.GoodsId.medal,
//                     num: 3
//                 }
//             ]
//         });
//     };
//     t.prototype.shuaxin_jichu_xinxi = function () {
//         var e;
//         var t = AL_GAME_HUA_GameData.GameData.getInstance();
//         var n = AL_GAME_HUA_LatticeConfig.LatticeConfig.getInstance();
//         var o =
//             null ===
//                 (e =
//                     null === AL_GAME_HUA_Instance.Instance || void 0 === AL_GAME_HUA_Instance.Instance
//                         ? void 0
//                         : AL_GAME_HUA_Instance.Instance.Game) || void 0 === e
//                 ? void 0
//                 : e.stage;
//         if (o) {
//             var i = AL_GAME_HUA_LatticeConfig.LatticeConfig.getInstance().huoqu_nandu_by_guanqia(t.huoqu_yijiesuo_guanqia());
//             var r = t.huoqu_dangqian_nandu();
//             var a = i + r;
//             var p = o.levelData;
//             var f = o.latticeConfig;
//             var d = p.Number;
//             var h = p.Type;
//             var _ = p.Empty;
//             var P = p.Null0;
//             var g = p.Null1;
//             var y = p.Null2;
//             var m = p.Null3;
//             var v = f.id;
//             var D = f.difficult;
//             var L = f.displaceBase;
//             var b = f.zhixing_cengji_weiyi_caozuo;
//             var C = f.increaseBase;
//             var H = f.increaseLayer;
//             var I = f.reduceBase;
//             var S = f.reduceLayer;
//             var w = o.difficultConf;
//             var Y =
//                 AL_GAME_HUA_Instance.Instance.LevelType == AL_GAME_HUA_Define.Define.LevelType.NORMAL
//                     ? t.huoqu_yijiesuo_guanqia()
//                     : AL_GAME_HUA_Instance.Instance.LevelType == AL_GAME_HUA_Define.Define.LevelType.CHALLENGE
//                     ? AL_GAME_HUA_Instance.Instance.ChallengeLevel
//                     : AL_GAME_HUA_Instance.Instance.LevelType == AL_GAME_HUA_Define.Define.LevelType.SPECIAL
//                     ? t.huoqu_yijiesuo_teshu_guanqia()
//                     : 0;
//             var E = n.huoqu_guanqia_increase(Y);
//             var A = o.totalLayer;
//             var T = o.recordConf.displaceCount;
//             var R = o.recordConf.displaceElement;
//             var G = "|";
//             for (var N in o.recordConf.layerDisCount) G += o.recordConf.layerDisCount[N] + "|";
//             var k = "|";
//             for (var N in o.recordConf.layerDisRate) k += o.recordConf.layerDisRate[N].toFixed(1) + "%|";
//             var O = o.recordConf.displaceLayers;
//             var M = "|";
//             for (var B = 1; B <= 5; B++) {
//                 M += (o.recordConf.displaceLayerFb[B] || 0) + "|";
//             }
//             var x = o.recordConf.layerInfos;
//             for (B = 0; B < x.length; B++) {
//                 var j = x[B];
//                 var F = (j.layer, j.empty, j.emptyRate);
//                 var U = (j.crashCount, j.crashRate);
//                 var V = (j.nextConnectCount, j.nextConnectRate);
//                 (100 * F).toFixed(1);
//                 (100 * U).toFixed(1);
//                 (100 * V).toFixed(1);
//             }
//             var K = "-----关卡信息-----\n";
//             K += "当前关卡:" + Y + "\n";
//             K += "当前难度系数cos:" + i + "\n";
//             K += "当前关卡首层递增难度系数:" + E.toFixed(3) + "\n";
//             K += "用户难度系数:" + r + "\n";
//             K += "总难度系数:" + a + "\n";
//             K += "货架类型:" + v + "\n";
//             K += "货架难度:" + D + "\n";
//             K += "物品总数:" + d + "\n";
//             K += "物品种类:" + h + "\n";
//             K += "首层空位:" + _ + "\n";
//             K += "空0权重:" + P.toString() + "\n";
//             K += "空1权重:" + g.toString() + "\n";
//             K += "空2权重:" + y.toString() + "\n";
//             K += "成双权重:" + m.toString() + "\n";
//             K += "置换格子基数:(" + L.toString() + "),(" + b.toString() + ")\n";
//             K += "胜利难度系数:(" + C.toString() + "),(" + H.toString() + ")\n";
//             K += "失败难度系数:(" + I.toString() + "),(" + S.toString() + ")\n";
//             K += "实际置换值:(" + w.displaceBase.toFixed(2) + "," + w.zhixing_cengji_weiyi_caozuo.toFixed(2) + ")\n";
//             K += "\n";
//             K += "-----格子信息-----\n";
//             K += "总层数:" + A + "\n";
//             K += "置换货柜数:" + T + "\n";
//             K += "影响物品数:" + R + "\n";
//             K += "置换分布:" + G + "\n";
//             K += "置换概率:" + k + "\n";
//             K += "置换总层数:" + O + "\n";
//             K += "置换层数分布(1-5):" + M + "\n";
//             this.label_info.string = K;
//         } else {
//             this.label_info.string = "未进入游戏";
//         }
//     };
//     t.prototype.refresh_real_time = function () {
//         var e = AL_GAME_HUA_Instance.Instance.Game.stage.huoqu_youxiao_de_wangge();
//         var t = e.normals;
//         var n = e.singles;
//         var o = AL_GAME_HUA_Instance.Instance.Game.stage.jisuan_cengji_xinxi(-1, t, n);
//         var i = (o.layer, o.empty);
//         var r = o.emptyRate;
//         var a = o.crashCount;
//         var c = o.crashRate;
//         var l = o.nextConnectCount;
//         var u = o.nextConnectRate;
//         var p = "";
//         p += "空位数:" + i + "\n";
//         p += "空位率:" + (100 * r).toFixed(1) + "%\n";
//         p += "可消数:" + a + "\n";
//         p += "可消率:" + (100 * c).toFixed(1) + "%\n";
//         p += "下层关联数:" + l + "\n";
//         p += "下层关联率:" + (100 * u).toFixed(1) + "%\n";
//         this.label_info.string = "-----实时首层信息-----\n" + p;
//     };
//     __decorate([m(cc.Label)], t.prototype, "label_info", void 0);
//     __decorate([m(cc.ScrollView)], t.prototype, "scroll_view_info", void 0);
//     __decorate([m(cc.EditBox)], t.prototype, "editbox_level", void 0);
//     __decorate([m(cc.EditBox)], t.prototype, "editbox_diff", void 0);
//     __decorate([m(cc.Label)], t.prototype, "label_button_info", void 0);
//     __decorate([m(cc.Label)], t.prototype, "label_date", void 0);
//     return __decorate([y], t);
// })(cc.Component);
// exports.default = D;


// 引入外部模块
const HY01_HDPP_Instance = require("./AL_GAME_HUA_Instance");
const HY01_HDPP_Define = require("./AL_GAME_HUA_Define");
const HY01_HDPP_LatticeConfig = require("./AL_GAME_HUA_LatticeConfig");
const HY01_HDPP_GameData = require("./AL_GAME_HUA_GameData");
const HY01_HDPP_DateData = require("./AL_GAME_HUA_DateData");
const HY01_HDPP_PlayerInfo = require("./AL_GAME_HUA_PlayerInfo");
const HY01_HDPP_EmailData = require("./AL_GAME_HUA_EmailData");
const HY01_HDPP_Common = require("./AL_GAME_HUA_Common");
const HY01_HDPP_GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");
const HY01_HDPP_ServerBackup = require("./AL_GAME_HUA_ServerBackup");

const {ccclass, property} = cc._decorator;

// 全局变量，用于切换实时和基础视图
let isRealTimeView = false;

/**
 * @class
 * @extends cc.Component
 * AL_GAME_HUA_ExampleClass类
 */
@ccclass
class AL_GAME_HUA_ExampleClass extends cc.Component {
    @property(cc.Label)
    label_info = null;

    @property(cc.ScrollView)
    scroll_view_info = null;

    @property(cc.EditBox)
    editbox_level = null;

    @property(cc.EditBox)
    editbox_diff = null;

    @property(cc.Label)
    label_button_info = null;

    @property(cc.Label)
    label_date = null;

    /**
     * 类初始化时调用
     */
    start() {
        if (HY01_HDPP_Instance.Instance.Game) {
            this.chushihua_ui();
            this.xianshi_shishi_huo_jichu_xinxi();
        }
    }

    /**
     * 显示实时或基础信息
     */
    xianshi_shishi_huo_jichu_xinxi() {
        if (HY01_HDPP_Instance.Instance.Game) {
            isRealTimeView
                ? ((this.label_button_info.string = "基础"), this.refresh_real_time())
                : ((this.label_button_info.string = "实时"), this.shuaxin_jichu_xinxi());
        }
    }

    /**
     * 初始化界面UI
     */
    chushihua_ui() {
        this.editbox_diff.string = HY01_HDPP_GameData.GameData.getInstance().huoqu_dangqian_nandu().toString();
        this.label_date.string = "" + new Date(HY01_HDPP_DateData.DateData.getInstance().huoqu_dangqian_shijian()).toLocaleDateString();
    }

    /**
     * 按钮点击事件回调
     * @param {Event} event - 事件对象
     * @param {string} eventType - 事件类型
     */
    handle_button_callback(event, eventType) {
        switch (eventType) {
            case "infoButton":
                isRealTimeView = !isRealTimeView;
                this.xianshi_shishi_huo_jichu_xinxi();
                break;
            case "close":
                this.node.destroy();
                break;
            case "skip":
                if (HY01_HDPP_Instance.Instance.Game) {
                    HY01_HDPP_Instance.Instance.Game.chuli_youxi_shengli();
                }
                break;
            case "choose":
                this.handle_choose_level();
                break;
            case "restart":
                if (HY01_HDPP_Instance.Instance.Game) {
                    HY01_HDPP_Instance.Instance.Game.chuli_youxi_chongxinkaishi();
                }
                break;
            case "dif":
                this.handle_Difficult_change();
                break;
            case "prop":
                this.add_props();
                break;
            case "reduceTime":
                if (HY01_HDPP_Instance.Instance.Game) {
                    HY01_HDPP_Instance.Instance.Game.gameTime += 30;
                }
                break;
            case "nextDay":
                this.advance_to_next_day();
                break;
            
            case "zengjia_dengji":
                HY01_HDPP_PlayerInfo.PlayerInfo.getInstance().zengjia_dengji();
                break;
            case "add_Medal":
                HY01_HDPP_PlayerInfo.PlayerInfo.getInstance().add_Medal(1);
                break;
            case "test_email":
                this.test_email();
                break;
            case "debug_rank":
                this.debug_rank();
                break;
            case "clear_storage":
                this.clear_storage();
        }
    }

    /**
     * 处理选择关卡
     */
    handle_choose_level() {
        if (!HY01_HDPP_Instance.Instance.Game) return;

        if (HY01_HDPP_Instance.Instance.LevelType === HY01_HDPP_Define.Define.LevelType.CHALLENGE) {
            return AL_APP_SDK_MANAGER.showToast("挑战模式不可选关");
        }

        if (HY01_HDPP_Instance.Instance.LevelType === HY01_HDPP_Define.Define.LevelType.NORMAL) {
            if (Number(this.editbox_level.string) > 0) {
                HY01_HDPP_GameData.GameData.getInstance().unlockLevel = parseInt(this.editbox_level.string);
                if (HY01_HDPP_Instance.Instance.Game) {
                    HY01_HDPP_Instance.Instance.Game.chuli_youxi_chongxinkaishi();
                }
            } else {
                AL_APP_SDK_MANAGER.showToast("关卡数不合法");
            }
        } else if (HY01_HDPP_Instance.Instance.LevelType === HY01_HDPP_Define.Define.LevelType.SPECIAL) {
            if (Number(this.editbox_level.string) > 0) {
                HY01_HDPP_GameData.GameData.getInstance().specialUnlockLevel = parseInt(this.editbox_level.string);
                if (HY01_HDPP_Instance.Instance.Game) {
                    HY01_HDPP_Instance.Instance.Game.chuli_youxi_chongxinkaishi();
                }
            } else {
                AL_APP_SDK_MANAGER.showToast("关卡数不合法");
            }
        }
    }

    /**
     * 处理难度变化
     */
    handle_Difficult_change() {
        const difficultyLevel = Number(this.editbox_diff.string);
        if (difficultyLevel >= 0) {
            HY01_HDPP_GameData.GameData.getInstance().shezhi_dangqian_nandu(difficultyLevel);
        } else {
            AL_APP_SDK_MANAGER.showToast("难度数不合法");
        }
    }

    /**
     * 添加道具
     */
    add_props() {
        const gameDataInstance = HY01_HDPP_GameData.GameData.getInstance();
        gameDataInstance.genggai_prop_shuliang(3, 10);
        gameDataInstance.genggai_prop_shuliang(4, 10);
        gameDataInstance.genggai_prop_shuliang(5, 10);
        gameDataInstance.genggai_prop_shuliang(6, 10);
    }

    /**
     * 将时间推进到下一天
     */
    advance_to_next_day() {
        const gameDataInstance = HY01_HDPP_GameData.GameData.getInstance();
        gameDataInstance.nowDate
            ? (gameDataInstance.nowDate += 864e5)
            : (gameDataInstance.nowDate = Date.now() + 864e5);
        HY01_HDPP_DateData.DateData.getInstance().jiancha_riqi_he_zhou_shifou_xuyao_shuaxin();
        this.label_date.string = "" + new Date(HY01_HDPP_DateData.DateData.getInstance().huoqu_dangqian_shijian()).toLocaleDateString();
    }

    /**
     * 测试邮件功能
     */
    test_email() {
        HY01_HDPP_EmailData.EmailData.getInstance().tianjia_youjian({
            id: HY01_HDPP_Common.Common.huoqu_dangqian_shijian(),
            title: "测试邮件1",
            desc: "测试邮件1内容",
            type: 2,
            createTime: HY01_HDPP_Common.Common.huoqu_dangqian_shijian(),
            validTime: 1,
            rewards: [
                {
                    goodsId: HY01_HDPP_GoodsConfig.GoodsId.gold,
                    num: 10
                },
                {
                    goodsId: HY01_HDPP_GoodsConfig.GoodsId.vit,
                    num: 5
                },
                {
                    goodsId: HY01_HDPP_GoodsConfig.GoodsId.medal,
                    num: 3
                }
            ]
        });
    }

    /**
     * 调试排行功能
     */
    debug_rank() {
        const playerInfoInstance = HY01_HDPP_PlayerInfo.PlayerInfo.getInstance();
        playerInfoInstance.ceshihuanjing_shengcheng_wanjia_xinxi();
        playerInfoInstance.tijiao_dengji_dao_shijie_paihangbang(Math.get_random_int(1, 1e4));
    }

    /**
     * 清除存储
     */
    clear_storage() {
        HY01_HDPP_ServerBackup.ServerBackup.qingchu_cundang().then(() => {
            AL_APP_SDK_MANAGER.showToast("存档清除完成");
        });
    }

    /**
     * 刷新基础信息
     */
    shuaxin_jichu_xinxi() {
        let infoStr = "未进入游戏";
        const instanceGame = HY01_HDPP_Instance.Instance.Game;
        
        if (!instanceGame || !instanceGame.stage) {
            this.label_info.string = infoStr;
            return;
        }
        
        const gameDataInstance = HY01_HDPP_GameData.GameData.getInstance();
        const latticeConfigInstance = HY01_HDPP_LatticeConfig.LatticeConfig.getInstance();
        
        let stage = instanceGame.stage;
        const difficulty = latticeConfigInstance.huoqu_nandu_by_guanqia(gameDataInstance.huoqu_yijiesuo_guanqia());
        const userDifficulty = gameDataInstance.huoqu_dangqian_nandu();
        const totalDifficulty = difficulty + userDifficulty;
        
        // 取得关卡相关数据
        const { levelData, latticeConfig, recordConf, difficultConf } = stage;
        const { Number, Type, Empty, Null0, Null1, Null2, Null3 } = levelData;
        const { id, difficult, displaceBase, zhixing_cengji_weiyi_caozuo, increaseBase, increaseLayer, reduceBase, reduceLayer } = latticeConfig;
        
        // 获取实际层级和解锁等级信息
        const levelType = HY01_HDPP_Instance.Instance.LevelType;
        const unlockLevel = levelType === HY01_HDPP_Define.Define.LevelType.NORMAL
            ? gameDataInstance.huoqu_yijiesuo_guanqia()
            : levelType === HY01_HDPP_Define.Define.LevelType.CHALLENGE
            ? HY01_HDPP_Instance.Instance.ChallengeLevel
            : levelType === HY01_HDPP_Define.Define.LevelType.SPECIAL
            ? gameDataInstance.huoqu_yijiesuo_teshu_guanqia()
            : 0;
            
        const levelIncrease = latticeConfigInstance.huoqu_guanqia_increase(unlockLevel);
        
        // 分别取各层信息数据
        const { layerDisCount, layerDisRate, displaceLayers, displaceLayerFb, layerInfos } = recordConf;
        const totalLayer = stage.totalLayer;
        
        // 生成关卡信息
        infoStr = `-----关卡信息-----
当前关卡: ${unlockLevel}
当前难度系数cos: ${difficulty}
当前关卡首层递增难度系数: ${levelIncrease.toFixed(3)}
用户难度系数: ${userDifficulty}
总难度系数: ${totalDifficulty}
货架类型: ${id}
货架难度: ${difficult}
物品总数: ${Number}
物品种类: ${Type}
首层空位: ${Empty}
空0权重: ${Null0}
空1权重: ${Null1}
空2权重: ${Null2}
成双权重: ${Null3}
置换格子基数: (${displaceBase}),(${zhixing_cengji_weiyi_caozuo})
胜利难度系数: (${increaseBase}),(${increaseLayer})
失败难度系数: (${reduceBase}),(${reduceLayer})
实际置换值: (${difficultConf.displaceBase.toFixed(2)},${difficultConf.zhixing_cengji_weiyi_caozuo.toFixed(2)})
        
-----格子信息-----
总层数: ${totalLayer}
置换货柜数: ${recordConf.displaceCount}
影响物品数: ${recordConf.displaceElement}
置换分布: |${Object.values(layerDisCount).join('|')}|
置换概率: |${Object.values(layerDisRate).map(rate => rate.toFixed(1) + '%').join('|')}|
置换总层数: ${displaceLayers}
置换层数分布(1-5): |${Object.values(displaceLayerFb).slice(0, 5).join('|')}|`;

        // 追加层级详细信息
        for (let layerInfo of layerInfos) {
            const { layer, empty, emptyRate, crashCount, crashRate, nextConnectCount, nextConnectRate } = layerInfo;
            const emptyRateFormatted = (100 * emptyRate).toFixed(1);
            const crashRateFormatted = (100 * crashRate).toFixed(1);
            const nextConnectRateFormatted = (100 * nextConnectRate).toFixed(1);
            
            // 添加层级信息
            infoStr += `
层级: ${layer} 空位: ${empty} 空位率: ${emptyRateFormatted} 可消数: ${crashCount} 可消率: ${crashRateFormatted}%
下层关联数: ${nextConnectCount} 下层关联率: ${nextConnectRateFormatted}%`;
        }

        // 更新信息标签内容
        this.label_info.string = infoStr;
    }

    /**
     * 刷新实时信息
     */
    refresh_real_time() {
        const gameStage = HY01_HDPP_Instance.Instance.Game.stage;
        const validLattices = gameStage.huoqu_youxiao_de_wangge();
        const { normals, singles } = validLattices;
        const layerInfo = gameStage.jisuan_cengji_xinxi(-1, normals, singles);
        
        const p = `空位数: ${layerInfo.empty}
空位率: ${(100 * layerInfo.emptyRate).toFixed(1)}%
可消数: ${layerInfo.crashCount}
可消率: ${(100 * layerInfo.crashRate).toFixed(1)}%
下层关联数: ${layerInfo.nextConnectCount}
下层关联率: ${(100 * layerInfo.nextConnectRate).toFixed(1)}%
`;
        
        this.label_info.string = `-----实时首层信息-----
${p}`;
    }
}

// 导出默认类
exports.default = AL_GAME_HUA_ExampleClass;